#pragma once

#include <windows.h>

#define MAX_WL 1000

class Coordinator2D
{
	public:
		int X0, Y0;
		COLORREF colorX, colorY;
		//length of axises X, Y respectively will be drawn in world
		float dx, dy;
		HPEN penX, penY;
		//ratio world/screen
		float kx, ky;
		//Viewport
		int left, top, right, bottom;

		//Data
		HPEN dataPen;
		int maxN;// = (right - left)/step;
		float step;
		float data[MAX_WL];
		int n;

		//void world2Screen(float x, float y, int &x1, int &y1);
		int world2Screen(float value);

	public:
		Coordinator2D(void);
		Coordinator2D(int x0, int y0, COLORREF clx, COLORREF cly, float lx, float ly);
		~Coordinator2D(void);

		void setViewport(int l, int t, int r, int b);
		void setScale(float sclx, float scly);
		void moveTo(int x0, int y0);
		void draw(HDC);

		//predecated
		void addValue(float);
};

